﻿using System;
namespace AladdinGameFramework.Download
{
    /// <summary>
    /// 下载代理辅助器接口
    /// </summary>
    public interface IDownloadAgentHelper
    {
        /// <summary>
        /// 下载代理辅助器更新事件
        /// </summary>
        event EventHandler<DownloadAgentHelperUpdateEventArgs> DownloadAgentHelperUpdate;

        /// <summary>
        /// 下载代理器完成事件
        /// </summary>
        event EventHandler<DownloadAgentHelperCompleteEventArgs> DownloadAgentHelperComplete;

        /// <summary>
        /// 下载代理辅助器错误事件
        /// </summary>
        event EventHandler<DownloadAgentHelperErrorEventArgs> DownloadAgentHelperError;

        /// <summary>
        /// 通过下载代理服务器加载指定数据
        /// </summary>
        /// <returns>The download.</returns>
        /// <param name="downloadUrl">Download URL.</param>
        /// <param name="userData">User data.</param>
        void Download(string downloadUrl, object userData);

        /// <summary>
        /// 通过下载代理辅助器下载指定地址数据
        /// </summary>
        /// <returns>The download.</returns>
        /// <param name="downloadUrl">Download URL.</param>
        /// <param name="fromPosition">From position.</param>
        /// <param name="userData">User data.</param>
        void Download(string downloadUrl, int fromPosition, object userData);

        /// <summary>
        /// 通过下载代理辅助器下载制定地址的数据
        /// </summary>
        /// <returns>The download.</returns>
        /// <param name="downloadUrl">Download URL.</param>
        /// <param name="fromPosition">下载起始位置</param>
        /// <param name="toPosition">下载结束位置</param>
        /// <param name="userData">User data.</param>
        void Download(string downloadUrl, int fromPosition, int toPosition, object userData);

        /// <summary>
        /// 重置下载代理辅助器
        /// </summary>
        void Reset();
    }
}
